import { get, put, _delete } from '@/lin/plugin/axios'

class Order {

    static async getOrder(id) {
        const res = await get(`v1/order/${id}/detail`)
        return res
    }
    static async changeOrderStatus(id, status) {
        const res = await put(`v1/order/status?id=${id}&status=${status}`)
        return res
    }

    static async getOrders(page = 0, count = 10) {
        const res = await get('v1/order/page', { page, count })
        return res
    }
    static async search({ keyword, page, count, start, end }) {
        const res = await get('v1/order/search', {
            keyword,
            page,
            count,
            start,
            end,
        })
        return res
    }
    static async deleteOrder(id){
        const res = await _delete(`v1/order/${id}`)
    }

}
export default Order